-
Notifications
You must be signed in to change notification settings - Fork 808
[SYCL] Fix error with type aliases used as free function kernel args #20123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SYCL] Fix error with type aliases used as free function kernel args #20123
Conversation
This PR fixes type name that is being printed as free function kernel argument type in its forward-declaration in the integration header. Before the change, we used the original argument type name, which could be an alias - this patch makes use of the canonical type's name to make sure that all type aliases are "unwrapped".
template<typename T> | ||
[[__sycl_detail__::add_ir_attributes_function("sycl-nd-range-kernel", 2)]] | ||
void bar_using(ns::BarUsing<T> Arg) {} | ||
template void bar_using(ns::BarUsing<int>); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does something like
class A {
public:
using B = int;
};
void freefu(A::B a) {
}
work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it works, I added it as a test case in e327133
Failures in compatibility test suite are unrelated: this PR only changes integration header generation for free function kernels, but neither of failed tests uses the feature:
I will proceed with merge |
…ntel#20123) This PR fixes type name that is being printed as free function kernel argument type in its forward-declaration in the integration header. Before the change, we used the original argument type name, which could be an alias - this patch makes use of the canonical type's name to make sure that all type aliases are "unwrapped".
This is joined cherry-pick of #20187 and #20123 --- [SYCL] Allow free function kernel args be templated on integer expressions (#20187) `constexpr` variables are not forward-declarable so if one is used as a template parameter of a free function kernel argument, we cannot reference the variable, but must inline the value into the integration header. --- [SYCL] Fix error with type aliases used as free function kernel args (#20123) This PR fixes type name that is being printed as free function kernel argument type in its forward-declaration in the integration header. Before the change, we used the original argument type name, which could be an alias - this patch makes use of the canonical type's name to make sure that all type aliases are "unwrapped".
This PR fixes type name that is being printed as free function kernel argument type in its forward-declaration in the integration header.
Before the change, we used the original argument type name, which could be an alias - this patch makes use of the canonical type's name to make sure that all type aliases are "unwrapped".